package com.example.zhengchaojun.arcgis.basicesTest;

import android.view.View;
import android.widget.ListView;

import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.example.zhengchaojun.arcgis.R;
import com.example.zhengchaojun.arcgis.basicesTest.adapter.LayerListviewAdapter;
import com.example.zhengchaojun.arcgis.basicesTest.adapter.LeandListviewAdapter;

/**
 * 类描述：图层管理
 * 作者：郑朝军 on 2018/5/10
 * 邮箱：1250393285@qq.com
 * 公司：武汉智博创享科技有限公司
 * 修改人：郑朝军 on 2018/5/10
 * 修改备注：
 */
public class LayerManagerActivity extends BaseMapActivity
{
    private ListView m_listView, m_listView2,m_listView3;

    public int getLayoutID()
    {
        return R.layout.activity_layer;
    }

    public void initView()
    {
        super.initView();
        m_listView = findViewById(R.id.listView);
        m_listView2 = findViewById(R.id.listView2);
        m_listView3 = findViewById(R.id.listView3);
    }

    public void initData()
    {
        notifyDataSetChanged();
    }

    public void onClick(View view)
    {

    }

    public void notifyDataSetChanged()
    {
        ArcGISMap arcGISMap = m_mapView.getMap();
        LayerListviewAdapter adapter = new LayerListviewAdapter(this, arcGISMap.getBasemap().getBaseLayers());
        m_listView.setAdapter(adapter);


        LayerListviewAdapter adapter2 = new LayerListviewAdapter(this, arcGISMap.getOperationalLayers());
        m_listView2.setAdapter(adapter2);


        LeandListviewAdapter adapter3 = new LeandListviewAdapter(this, arcGISMap.getOperationalLayers());
        m_listView3.setAdapter(adapter3);
    }
}
